package Vista;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.JTextField;
import javax.swing.ListModel;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class OrdenV extends javax.swing.JFrame {
	private JPanel panelordenv;
	private JComboBox cmbproducto;
	private JButton btnotro;
	private JSeparator jSeparator3;
	private JTextField txtnombre;
	private JTextField txtcodcliente;
	private JTextField txtcdoorden;
	private JSeparator jSeparator2;
	private JTextField txttotal;
	private JLabel lbltotal;
	private JList lista;
	private JButton btnCancelar;
	private JButton btnRegistrar;
	private JLabel jLabel1;
	private JLabel lblprecio;
	private JTextField txtcantidad;
	private JLabel lblmsj;
	private JLabel lblsubtotal;
	private JLabel lblpreciou;
	private JLabel lblcant;
	private JLabel lblnomp;
	private JLabel lblnomc;
	private JLabel lblcodc;
	private JLabel lblcodo;

	/**
	* Auto-generated main method to display this JFrame
	*/
		
	public OrdenV() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			this.setTitle("Registro de Orden");
			{
				panelordenv = new JPanel();
				getContentPane().add(panelordenv);
				panelordenv.setBounds(0, 0, 572, 431);
				panelordenv.setLayout(null);
				{
					lblcodo = new JLabel();
					panelordenv.add(lblcodo);
					lblcodo.setText("Codigo de Orden:");
					lblcodo.setBounds(7, 60, 129, 17);
					lblcodo.setFont(new java.awt.Font("Bookman Uralic",2,14));
				}
				{
					lblcodc = new JLabel();
					panelordenv.add(lblcodc);
					lblcodc.setText("Codigo del Cliente:");
					lblcodc.setBounds(236, 26, 146, 17);
					lblcodc.setFont(new java.awt.Font("Bookman Uralic",2,14));
				}
				{
					lblnomc = new JLabel();
					panelordenv.add(lblnomc);
					lblnomc.setText("Nombre:");
					lblnomc.setBounds(12, 26, 73, 17);
					lblnomc.setFont(new java.awt.Font("Bookman Uralic",2,14));
				}
				{
					lblnomp = new JLabel();
					panelordenv.add(lblnomp);
					lblnomp.setText("Producto");
					lblnomp.setBounds(45, 104, 60, 17);
					lblnomp.setFont(new java.awt.Font("Bookman Uralic",2,14));
				}
				{
					lblcant = new JLabel();
					panelordenv.add(lblcant);
					lblcant.setText("Cantidad");
					lblcant.setBounds(167, 104, 64, 17);
					lblcant.setFont(new java.awt.Font("Bookman Uralic",2,14));
				}
				{
					lblmsj = new JLabel();
					panelordenv.add(lblmsj);
					lblmsj.setText("Orden");
					lblmsj.setBounds(262, 73, 54, 21);
					lblmsj.setFont(new java.awt.Font("Bookman Uralic",2,18));
				}
				{
					ComboBoxModel cmbproductoModel = 
						new DefaultComboBoxModel(
								new String[] { "Seleccione..", " " });
					cmbproducto = new JComboBox();
					panelordenv.add(cmbproducto);
					cmbproducto.setModel(cmbproductoModel);
					cmbproducto.setBounds(41, 127, 79, 22);
				}
				{
					txtcantidad = new JTextField();
					panelordenv.add(txtcantidad);
					txtcantidad.setBounds(164, 128, 70, 22);
				}
				{
					lblpreciou = new JLabel();
					panelordenv.add(lblpreciou);
					lblpreciou.setText("Precio Uni.");
					lblpreciou.setBounds(271, 104, 72, 17);
					lblpreciou.setFont(new java.awt.Font("Bookman Uralic",2,14));
				}
				{
					lblprecio = new JLabel();
					panelordenv.add(lblprecio);
					lblprecio.setBounds(264, 128, 85, 22);
					lblprecio.setFont(new java.awt.Font("Bookman Uralic",2,14));
					lblprecio.setText("p");
				}
				{
					jLabel1 = new JLabel();
					panelordenv.add(jLabel1);
					jLabel1.setBounds(388, 127, 76, 22);
					jLabel1.setFont(new java.awt.Font("Bookman Uralic",2,14));
					jLabel1.setText("S");
				}
				{
					ListModel listaModel = 
						new DefaultComboBoxModel(
								new String[] { " ", " " });
					lista = new JList();
					panelordenv.add(lista);
					lista.setModel(listaModel);
					lista.setBounds(46, 161, 456, 172);
				}
				{
					lblsubtotal = new JLabel();
					panelordenv.add(lblsubtotal);
					lblsubtotal.setText("Sub-Total");
					lblsubtotal.setBounds(378, 104, 64, 17);
					lblsubtotal.setFont(new java.awt.Font("Bookman Uralic",2,14));
				}
				{
					btnotro = new JButton();
					panelordenv.add(btnotro);
					btnotro.setText("Otro");
					btnotro.setBounds(476, 115, 64, 35);
					btnotro.setFont(new java.awt.Font("Bookman Uralic",2,12));
					btnotro.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Imagenes/otro.2.png")));
				}
				{
					lbltotal = new JLabel();
					panelordenv.add(lbltotal);
					lbltotal.setText("Total:");
					lbltotal.setBounds(396, 361, 38, 17);
					lbltotal.setFont(new java.awt.Font("Bookman Uralic",2,14));
				}
				{
					txttotal = new JTextField();
					panelordenv.add(txttotal);
					txttotal.setBounds(446, 361, 71, 17);
				}
				{
					jSeparator2 = new JSeparator();
					panelordenv.add(jSeparator2);
					jSeparator2.setBounds(37, 95, 499, 10);
				}
				{
					txtcdoorden = new JTextField();
					panelordenv.add(txtcdoorden);
					txtcdoorden.setBounds(143, 59, 68, 22);
				}
				{
					txtcodcliente = new JTextField();
					panelordenv.add(txtcodcliente);
					txtcodcliente.setBounds(382, 24, 98, 22);
				}
				{
					txtnombre = new JTextField();
					panelordenv.add(txtnombre);
					txtnombre.setBounds(92, 24, 126, 22);
				}
				{
					jSeparator3 = new JSeparator();
					panelordenv.add(jSeparator3);
					jSeparator3.setBounds(34, 345, 502, 16);
				}
				{
					btnRegistrar = new JButton();
					panelordenv.add(btnRegistrar);
					btnRegistrar.setText("Registrar");
					btnRegistrar.setBounds(102, 359, 132, 53);
					btnRegistrar.setFont(new java.awt.Font("Bookman Uralic",2,12));
					btnRegistrar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Imagenes/cajareg.png")));
				}
				{
					btnCancelar = new JButton();
					panelordenv.add(btnCancelar);
					btnCancelar.setText("Cancelar");
					btnCancelar.setBounds(256, 357, 132, 53);
					btnCancelar.setFont(new java.awt.Font("Bookman Uralic",2,12));
					btnCancelar.setIcon(new ImageIcon(getClass().getClassLoader().getResource("Imagenes/48px-Crystal_Clear_action_stop.png")));
				}
			}
			pack();
			this.setSize(576, 463);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
public void Limpiar()
{
	txtcantidad.setText("");
	txtcdoorden.setText("");
	txttotal.setText("");
	txtnombre.setText("");
	txtcodcliente.setText("");
	cmbproducto.setToolTipText("Seleccione");
	lblprecio.setText("");
	jLabel1.setText("");
	
}
public void addListener(ActionListener actionListener) {
	btnRegistrar.addActionListener(actionListener);
	btnCancelar.addActionListener(actionListener);
	btnotro.addActionListener(actionListener);
}
public String getcantidad(){
	return txtcantidad.getText();
}
public String getcdoorden(){
	return txtcdoorden.getText();
}
public String getcodcliente(){
	return txtcodcliente.getText();
}
public String getnombre(){
	return txtnombre.getText();
}
public String gettotal(){
	return txttotal.getText();
}
public String getproducto(){
	return cmbproducto.getToolTipText();
}
public String getlistaorden(){
	return lista.getToolTipText();
}
public void mensaje(String sms){
	JOptionPane.showMessageDialog(this, sms);
}
}

